﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FlexControls
{
    public partial class fcButtonX : UserControl
    {
        public string strMaPhong = "";
        public int intGiaPhong = 0;
        public string strLoaiPhong = "";
        public string strNgay = "";
        public fcButtonX()
        {
            InitializeComponent();
        }

        public string Text
        {
            get
            {
                return butX.Text;
            }
            set
            {
                butX.Text = Convert.ToString(value);
            }
        }

        private void butTinhTien_Click(object sender, EventArgs e)
        {
            butX.Checked = false;
            chkDatPhong.Checked = false;
        }

        private void chkDatPhong_CheckedChanging(object sender, DevComponents.DotNetBar.CheckBoxChangeEventArgs e)
        {
            if (chkDatPhong.Checked == true && butX.Checked == true)
            {

                e.Cancel = true;
            }
            else if (chkDatPhong.Checked == false)
            {
                butX.Checked = true;
            }
        }

        private void fcButtonX_Load(object sender, EventArgs e)
        {
            
        }
        public void KhoiTaoButtonX()
        {
                    
            lblPhong.Text = strMaPhong;
            lblGiaPhong.Text =Convert.ToString( intGiaPhong);
            lblNgay.Text = strNgay;
        }

        private void chkDatTruoc_CheckedChanged(object sender, DevComponents.DotNetBar.CheckBoxChangeEventArgs e)
        {
            if (chkDatTruoc.Checked == true)
            {
                chkDatPhong.Checked = false;
                lblNgay.Text = System.DateTime.Today.ToShortDateString();
            }
        }

        private void chkDatPhong_CheckedChanged(object sender, DevComponents.DotNetBar.CheckBoxChangeEventArgs e)
        {
            if (chkDatPhong.Checked == true)
            {
                chkDatTruoc.Checked = false;
                lblNgay.Text = System.DateTime.Today.ToShortDateString();
            }
        }
        
    }
}
